/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package meteocal.business.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author luana
 */
@Entity
@Table(name = "WEATHER")
@NamedQueries({
    @NamedQuery(name = "Weather.findAll", query = "SELECT w FROM Weather w"),
    @NamedQuery(name = "Weather.findByIdWeather", query = "SELECT w FROM Weather w WHERE w.idWeather = :idWeather"),
    @NamedQuery(name = "Weather.findByName", query = "SELECT w FROM Weather w WHERE w.name = :name"),
    @NamedQuery(name = "Weather.findBySymbolUrl", query = "SELECT w FROM Weather w WHERE w.symbolUrl = :symbolUrl")})

public class Weather implements Serializable {
   
    
   
    
    private static final long serialVersionUID = 1L;

    @Id
    @Basic(optional = false)
    @Column(name = "ID_WEATHER")
    private Integer idWeather;
    
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "NAME")
    private String name;
    
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "CATEGORY")
    private String category;
    
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "SYMBOL_URL")
    private String symbolUrl;
    
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "expectedWeather")
    private Collection<Event> eventCollection;

    public Weather() {
        
    }

    public Weather(Integer idWeather) {
        this.idWeather = idWeather;
    }

    public Weather(Integer idWeather, String name, String category, String symbolUrl) {
        this.idWeather = idWeather;
        this.name = name;
        this.category = category; 
        this.symbolUrl = symbolUrl;
    }

    public Integer getIdWeather() {
        return idWeather;
    }

    public void setIdWeather(Integer idWeather) {
        this.idWeather = idWeather;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSymbolUrl() {
        return symbolUrl;
    }

    public void setSymbolUrl(String symbolUrl) {
        this.symbolUrl = symbolUrl;
    }

    public Collection<Event> getEventCollection() {
        return eventCollection;
    }

    public void setEventCollection(Collection<Event> eventCollection) {
        this.eventCollection = eventCollection;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

}
